#include "demux.h"
#include "../../logging/Logging.h"
#include "../../net/EventLoop.h"
#include "../../net/InetAddress.h"
using namespace yhaida;
namespace
{
    const uint16_t kListenPort = 9999;
    const char *socksIp = "127.0.0.1";
    const uint16_t kSocksPort = 7777;
}
int main(int argc, char *argv[])
{
    LOG_INFO << "pid = " << getpid();
    EventLoop loop;
    InetAddress listenAddr(kListenPort);
    if (argc > 1)
    {
        socksIp = argv[1];
    }
    InetAddress socksAddr(socksIp, kSocksPort);
    DemuxServer server(&loop, listenAddr, socksAddr);

    server.start();

    loop.loop();
}